package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 快修店评论表
 * @TableName shop_reviews
 */
@TableName(value ="shop_reviews")
@Data
public class ShopReviews implements Serializable {
    /**
     * 评论ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 被评论的快修店ID
     */
    private Long shopId;

    /**
     * 评论用户ID
     */
    private Long userId;

    /**
     * 评分(1.0-5.0)
     */
    private BigDecimal rating;

    /**
     * 评论内容
     */
    private String comment;

    /**
     * 服务质量评分(1-5)
     */
    private Integer serviceQuality;

    /**
     * 价格合理性评分(1-5)
     */
    private Integer priceReasonable;

    /**
     * 服务速度评分(1-5)
     */
    private Integer serviceSpeed;

    /**
     * 服务态度评分(1-5)
     */
    private Integer attitude;

    /**
     * 状态(0-隐藏,1-显示)
     */
    private Integer status;

    /**
     * 评论时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ShopReviews other = (ShopReviews) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getRating() == null ? other.getRating() == null : this.getRating().equals(other.getRating()))
            && (this.getComment() == null ? other.getComment() == null : this.getComment().equals(other.getComment()))
            && (this.getServiceQuality() == null ? other.getServiceQuality() == null : this.getServiceQuality().equals(other.getServiceQuality()))
            && (this.getPriceReasonable() == null ? other.getPriceReasonable() == null : this.getPriceReasonable().equals(other.getPriceReasonable()))
            && (this.getServiceSpeed() == null ? other.getServiceSpeed() == null : this.getServiceSpeed().equals(other.getServiceSpeed()))
            && (this.getAttitude() == null ? other.getAttitude() == null : this.getAttitude().equals(other.getAttitude()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getRating() == null) ? 0 : getRating().hashCode());
        result = prime * result + ((getComment() == null) ? 0 : getComment().hashCode());
        result = prime * result + ((getServiceQuality() == null) ? 0 : getServiceQuality().hashCode());
        result = prime * result + ((getPriceReasonable() == null) ? 0 : getPriceReasonable().hashCode());
        result = prime * result + ((getServiceSpeed() == null) ? 0 : getServiceSpeed().hashCode());
        result = prime * result + ((getAttitude() == null) ? 0 : getAttitude().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", shopId=").append(shopId);
        sb.append(", userId=").append(userId);
        sb.append(", rating=").append(rating);
        sb.append(", comment=").append(comment);
        sb.append(", serviceQuality=").append(serviceQuality);
        sb.append(", priceReasonable=").append(priceReasonable);
        sb.append(", serviceSpeed=").append(serviceSpeed);
        sb.append(", attitude=").append(attitude);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}